﻿using Epam.PeopleInterfaces;
using Epam.PeopleModel;

namespace Epam.BusinessLogic
{
    public static class NewsMapper
    {
        public static INewsEntity Convert(IDtoNewsEntity entity)
        {
            return new NewsEntity(entity.Id,entity.Text,entity.Title,entity.Created);
        }

        public static IViewNewsEntity ConvertToViewEntity(IDtoNewsEntity entity,INewsSkipAlgoritm skipAlgoritm)
        {
            return new ViewNewsEntity(entity.Id,skipAlgoritm.SkipNews(entity.Text), entity.Title, entity.Created);
        }
    }
}
